\(\int \frac {(d+e x) (a+b \log (c x^n))^2}{x^5} \, dx\) [83]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 109 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {b^2 d n^2}{32 x^4}-\frac {2 b^2 e n^2}{27 x^3}-\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{8 x^4}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{9 x^3}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{4 x^4}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{3 x^3} \]

[Out]

-1/32*b^2*d*n^2/x^4-2/27*b^2*e*n^2/x^3-1/8*b*d*n*(a+b*ln(c*x^n))/x^4-2/9*b*e*n*(a+b*ln(c*x^n))/x^3-1/4*d*(a+b*
ln(c*x^n))^2/x^4-1/3*e*(a+b*ln(c*x^n))^2/x^3

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {2395, 2342, 2341} \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{8 x^4}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{4 x^4}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{9 x^3}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{3 x^3}-\frac {b^2 d n^2}{32 x^4}-\frac {2 b^2 e n^2}{27 x^3} \]

[In]

Int[((d + e*x)*(a + b*Log[c*x^n])^2)/x^5,x]

[Out]

-1/32*(b^2*d*n^2)/x^4 - (2*b^2*e*n^2)/(27*x^3) - (b*d*n*(a + b*Log[c*x^n]))/(8*x^4) - (2*b*e*n*(a + b*Log[c*x^
n]))/(9*x^3) - (d*(a + b*Log[c*x^n])^2)/(4*x^4) - (e*(a + b*Log[c*x^n])^2)/(3*x^3)

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2342

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Lo
g[c*x^n])^p/(d*(m + 1))), x] - Dist[b*n*(p/(m + 1)), Int[(d*x)^m*(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{
a, b, c, d, m, n}, x] && NeQ[m, -1] && GtQ[p, 0]

Rule 2395

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol]
:> With[{u = ExpandIntegrand[(a + b*Log[c*x^n])^p, (f*x)^m*(d + e*x^r)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[
{a, b, c, d, e, f, m, n, p, q, r}, x] && IntegerQ[q] && (GtQ[q, 0] || (IGtQ[p, 0] && IntegerQ[m] && IntegerQ[r
]))

Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{x^5}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{x^4}\right ) \, dx \\ & = d \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx+e \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{x^4} \, dx \\ & = -\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{4 x^4}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{3 x^3}+\frac {1}{2} (b d n) \int \frac {a+b \log \left (c x^n\right )}{x^5} \, dx+\frac {1}{3} (2 b e n) \int \frac {a+b \log \left (c x^n\right )}{x^4} \, dx \\ & = -\frac {b^2 d n^2}{32 x^4}-\frac {2 b^2 e n^2}{27 x^3}-\frac {b d n \left (a+b \log \left (c x^n\right )\right )}{8 x^4}-\frac {2 b e n \left (a+b \log \left (c x^n\right )\right )}{9 x^3}-\frac {d \left (a+b \log \left (c x^n\right )\right )^2}{4 x^4}-\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{3 x^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 82, normalized size of antiderivative = 0.75 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {216 d \left (a+b \log \left (c x^n\right )\right )^2+288 e x \left (a+b \log \left (c x^n\right )\right )^2+64 b e n x \left (3 a+b n+3 b \log \left (c x^n\right )\right )+27 b d n \left (4 a+b n+4 b \log \left (c x^n\right )\right )}{864 x^4} \]

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n])^2)/x^5,x]

[Out]

-1/864*(216*d*(a + b*Log[c*x^n])^2 + 288*e*x*(a + b*Log[c*x^n])^2 + 64*b*e*n*x*(3*a + b*n + 3*b*Log[c*x^n]) +
27*b*d*n*(4*a + b*n + 4*b*Log[c*x^n]))/x^4

Maple [A] (verified)

Time = 0.14 (sec) , antiderivative size = 131, normalized size of antiderivative = 1.20

method result size
parallelrisch \(-\frac {288 b^{2} \ln \left (c \,x^{n}\right )^{2} e x +192 b^{2} e n x \ln \left (c \,x^{n}\right )+64 b^{2} e \,n^{2} x +576 a b \ln \left (c \,x^{n}\right ) e x +192 a b e n x +216 b^{2} \ln \left (c \,x^{n}\right )^{2} d +108 \ln \left (c \,x^{n}\right ) b^{2} n d +27 b^{2} d \,n^{2}+288 a^{2} e x +432 a b \ln \left (c \,x^{n}\right ) d +108 a b d n +216 a^{2} d}{864 x^{4}}\) \(131\)
risch \(\text {Expression too large to display}\) \(1486\)

[In]

int((e*x+d)*(a+b*ln(c*x^n))^2/x^5,x,method=_RETURNVERBOSE)

[Out]

-1/864/x^4*(288*b^2*ln(c*x^n)^2*e*x+192*b^2*e*n*x*ln(c*x^n)+64*b^2*e*n^2*x+576*a*b*ln(c*x^n)*e*x+192*a*b*e*n*x
+216*b^2*ln(c*x^n)^2*d+108*ln(c*x^n)*b^2*n*d+27*b^2*d*n^2+288*a^2*e*x+432*a*b*ln(c*x^n)*d+108*a*b*d*n+216*a^2*
d)

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 188, normalized size of antiderivative = 1.72 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {27 \, b^{2} d n^{2} + 108 \, a b d n + 216 \, a^{2} d + 72 \, {\left (4 \, b^{2} e x + 3 \, b^{2} d\right )} \log \left (c\right )^{2} + 72 \, {\left (4 \, b^{2} e n^{2} x + 3 \, b^{2} d n^{2}\right )} \log \left (x\right )^{2} + 32 \, {\left (2 \, b^{2} e n^{2} + 6 \, a b e n + 9 \, a^{2} e\right )} x + 12 \, {\left (9 \, b^{2} d n + 36 \, a b d + 16 \, {\left (b^{2} e n + 3 \, a b e\right )} x\right )} \log \left (c\right ) + 12 \, {\left (9 \, b^{2} d n^{2} + 36 \, a b d n + 16 \, {\left (b^{2} e n^{2} + 3 \, a b e n\right )} x + 12 \, {\left (4 \, b^{2} e n x + 3 \, b^{2} d n\right )} \log \left (c\right )\right )} \log \left (x\right )}{864 \, x^{4}} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^5,x, algorithm="fricas")

[Out]

-1/864*(27*b^2*d*n^2 + 108*a*b*d*n + 216*a^2*d + 72*(4*b^2*e*x + 3*b^2*d)*log(c)^2 + 72*(4*b^2*e*n^2*x + 3*b^2
*d*n^2)*log(x)^2 + 32*(2*b^2*e*n^2 + 6*a*b*e*n + 9*a^2*e)*x + 12*(9*b^2*d*n + 36*a*b*d + 16*(b^2*e*n + 3*a*b*e
)*x)*log(c) + 12*(9*b^2*d*n^2 + 36*a*b*d*n + 16*(b^2*e*n^2 + 3*a*b*e*n)*x + 12*(4*b^2*e*n*x + 3*b^2*d*n)*log(c
))*log(x))/x^4

Sympy [A] (verification not implemented)

Time = 0.40 (sec) , antiderivative size = 187, normalized size of antiderivative = 1.72 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=- \frac {a^{2} d}{4 x^{4}} - \frac {a^{2} e}{3 x^{3}} - \frac {a b d n}{8 x^{4}} - \frac {a b d \log {\left (c x^{n} \right )}}{2 x^{4}} - \frac {2 a b e n}{9 x^{3}} - \frac {2 a b e \log {\left (c x^{n} \right )}}{3 x^{3}} - \frac {b^{2} d n^{2}}{32 x^{4}} - \frac {b^{2} d n \log {\left (c x^{n} \right )}}{8 x^{4}} - \frac {b^{2} d \log {\left (c x^{n} \right )}^{2}}{4 x^{4}} - \frac {2 b^{2} e n^{2}}{27 x^{3}} - \frac {2 b^{2} e n \log {\left (c x^{n} \right )}}{9 x^{3}} - \frac {b^{2} e \log {\left (c x^{n} \right )}^{2}}{3 x^{3}} \]

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))**2/x**5,x)

[Out]

-a**2*d/(4*x**4) - a**2*e/(3*x**3) - a*b*d*n/(8*x**4) - a*b*d*log(c*x**n)/(2*x**4) - 2*a*b*e*n/(9*x**3) - 2*a*
b*e*log(c*x**n)/(3*x**3) - b**2*d*n**2/(32*x**4) - b**2*d*n*log(c*x**n)/(8*x**4) - b**2*d*log(c*x**n)**2/(4*x*
*4) - 2*b**2*e*n**2/(27*x**3) - 2*b**2*e*n*log(c*x**n)/(9*x**3) - b**2*e*log(c*x**n)**2/(3*x**3)

Maxima [A] (verification not implemented)

none

Time = 0.21 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.39 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {2}{27} \, b^{2} e {\left (\frac {n^{2}}{x^{3}} + \frac {3 \, n \log \left (c x^{n}\right )}{x^{3}}\right )} - \frac {1}{32} \, b^{2} d {\left (\frac {n^{2}}{x^{4}} + \frac {4 \, n \log \left (c x^{n}\right )}{x^{4}}\right )} - \frac {b^{2} e \log \left (c x^{n}\right )^{2}}{3 \, x^{3}} - \frac {2 \, a b e n}{9 \, x^{3}} - \frac {2 \, a b e \log \left (c x^{n}\right )}{3 \, x^{3}} - \frac {b^{2} d \log \left (c x^{n}\right )^{2}}{4 \, x^{4}} - \frac {a b d n}{8 \, x^{4}} - \frac {a^{2} e}{3 \, x^{3}} - \frac {a b d \log \left (c x^{n}\right )}{2 \, x^{4}} - \frac {a^{2} d}{4 \, x^{4}} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^5,x, algorithm="maxima")

[Out]

-2/27*b^2*e*(n^2/x^3 + 3*n*log(c*x^n)/x^3) - 1/32*b^2*d*(n^2/x^4 + 4*n*log(c*x^n)/x^4) - 1/3*b^2*e*log(c*x^n)^
2/x^3 - 2/9*a*b*e*n/x^3 - 2/3*a*b*e*log(c*x^n)/x^3 - 1/4*b^2*d*log(c*x^n)^2/x^4 - 1/8*a*b*d*n/x^4 - 1/3*a^2*e/
x^3 - 1/2*a*b*d*log(c*x^n)/x^4 - 1/4*a^2*d/x^4

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (97) = 194\).

Time = 0.44 (sec) , antiderivative size = 195, normalized size of antiderivative = 1.79 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {{\left (4 \, b^{2} e n^{2} x + 3 \, b^{2} d n^{2}\right )} \log \left (x\right )^{2}}{12 \, x^{4}} - \frac {{\left (16 \, b^{2} e n^{2} x + 48 \, b^{2} e n x \log \left (c\right ) + 9 \, b^{2} d n^{2} + 48 \, a b e n x + 36 \, b^{2} d n \log \left (c\right ) + 36 \, a b d n\right )} \log \left (x\right )}{72 \, x^{4}} - \frac {64 \, b^{2} e n^{2} x + 192 \, b^{2} e n x \log \left (c\right ) + 288 \, b^{2} e x \log \left (c\right )^{2} + 27 \, b^{2} d n^{2} + 192 \, a b e n x + 108 \, b^{2} d n \log \left (c\right ) + 576 \, a b e x \log \left (c\right ) + 216 \, b^{2} d \log \left (c\right )^{2} + 108 \, a b d n + 288 \, a^{2} e x + 432 \, a b d \log \left (c\right ) + 216 \, a^{2} d}{864 \, x^{4}} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))^2/x^5,x, algorithm="giac")

[Out]

-1/12*(4*b^2*e*n^2*x + 3*b^2*d*n^2)*log(x)^2/x^4 - 1/72*(16*b^2*e*n^2*x + 48*b^2*e*n*x*log(c) + 9*b^2*d*n^2 +
48*a*b*e*n*x + 36*b^2*d*n*log(c) + 36*a*b*d*n)*log(x)/x^4 - 1/864*(64*b^2*e*n^2*x + 192*b^2*e*n*x*log(c) + 288
*b^2*e*x*log(c)^2 + 27*b^2*d*n^2 + 192*a*b*e*n*x + 108*b^2*d*n*log(c) + 576*a*b*e*x*log(c) + 216*b^2*d*log(c)^
2 + 108*a*b*d*n + 288*a^2*e*x + 432*a*b*d*log(c) + 216*a^2*d)/x^4

Mupad [B] (verification not implemented)

Time = 0.52 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.05 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )^2}{x^5} \, dx=-\frac {x\,\left (24\,e\,a^2+16\,e\,a\,b\,n+\frac {16\,e\,b^2\,n^2}{3}\right )+18\,a^2\,d+\frac {9\,b^2\,d\,n^2}{4}+9\,a\,b\,d\,n}{72\,x^4}-\frac {\ln \left (c\,x^n\right )\,\left (\frac {3\,b\,d\,\left (4\,a+b\,n\right )}{4}+\frac {4\,b\,e\,x\,\left (3\,a+b\,n\right )}{3}\right )}{6\,x^4}-\frac {{\ln \left (c\,x^n\right )}^2\,\left (\frac {b^2\,d}{4}+\frac {b^2\,e\,x}{3}\right )}{x^4} \]

[In]

int(((a + b*log(c*x^n))^2*(d + e*x))/x^5,x)

[Out]

- (x*(24*a^2*e + (16*b^2*e*n^2)/3 + 16*a*b*e*n) + 18*a^2*d + (9*b^2*d*n^2)/4 + 9*a*b*d*n)/(72*x^4) - (log(c*x^
n)*((3*b*d*(4*a + b*n))/4 + (4*b*e*x*(3*a + b*n))/3))/(6*x^4) - (log(c*x^n)^2*((b^2*d)/4 + (b^2*e*x)/3))/x^4